package com.newhero.product.common.freemarker;

import java.io.IOException;

import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;

import com.jagregory.shiro.freemarker.ShiroTags;

import freemarker.template.TemplateException;

/**
 * @ClassName: ShiroTagFreeMarkerConfigurer
 * @Description: 
 *               自定义一个ShiroTagFreeMarkerConfigurer继承Spring本身提供的FreeMarkerConfigurer
 *               , 目的是在FreeMarker的Configuration中添加shiro的配置
 * @author Caolj 648198687@qq.com
 * @date 2017-3-17 上午11:08:10
 */
public class ShiroTagFreeMarkerConfigurer extends FreeMarkerConfigurer {

	@Override
	public void afterPropertiesSet() throws IOException, TemplateException {
		super.afterPropertiesSet();
		this.getConfiguration().setSharedVariable("shiro", new ShiroTags());
	}
}
